extends /templates/base

//- DO NOT TRANSLATE

block content

  h3 Classroom Levels
  if !me.isAdmin()
    div You must be logged in as an admin to view this page.
  else
    p
      - var levelsTotal = 0;
      table.table.table-striped.table-condensed
        tr
          th Levels
          th Course
        each course in view.courses.models
          if course.get('releasePhase') !== 'released'
            - continue;
          - var campaign = view.campaigns.get(course.get('campaignID'));
          if !campaign
            - continue;
          - var levels = campaign.getLevels().models;
          - levelsTotal += levels.length;
          tr
            td= levels.length
            td= course.get('name')
        tr
          td= levelsTotal
          td All
    - var conceptsSeen = {};
    each course in view.courses.models
      if course.get('releasePhase') !== 'released'
        - continue;
      - var campaign = view.campaigns.get(course.get('campaignID'));
      if !campaign
        - continue;
      - var levels = campaign.getLevels().models;
      - levelCounts = levels.length;
      strong #{course.get('name')}
      .small= course.get('description')
      .small Levels last updated #{campaign.get('levelsUpdated')}
      table.table.table-striped.table-condensed
        tr
          th= levels.length
          th Slug
          th Type
          th Practice
          th Practice Threshold (m)
          th Shareable
          th Primer
          th New Concepts
        each level, levelIndex in levels
          - var levelNumber = campaign.getLevelNumber(level.get('original'), levelIndex + 1)
          tr
            td
              a(href='/play/level/' + level.get('slug'))= levelNumber
            td= level.get('slug')
            td= level.get('type')
            td= level.get('practice')
            td= level.get('practiceThresholdMinutes')
            td= level.get('shareable')
            td= level.get('primerLanguage')
            td
              for concept in level.get('concepts') || []
                if !conceptsSeen[concept]
                  - conceptsSeen[concept] = true;
                  span= concept + ' '
